package cn.com.task;

import java.util.Date;
import java.util.concurrent.Callable;

public class TaskDemo2 implements Callable<Integer> {

    private int taskNum;

    public TaskDemo2(int taskNum) {
        this.taskNum = taskNum;
    }

    @Override
    public Integer call() throws Exception {
        System.out.println("taskNum：" + taskNum + "； " + new Date());
        if(taskNum == 1){
            int i = 1/0;
        }
        try {
            Thread.sleep(2000L);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return taskNum;
    }
}
